---
title: Chatbot initialization
sidebar_position: 3
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

Code with your favorite chatbot without tedious copy-pasting and apply responses with a single click.

Generated prompt depends on mode:

<Tabs groupId="mode">
  <TabItem value="general" label="General">

```
[INSTRUCTIONS]
<files>
  <document title="...">...</document> // selected websites
  ...
  <file path="...">...</file> // selected workspace files
  ...
</files>
[INSTRUCTIONS]
```

  </TabItem>
  <TabItem value="code completions" label="Code completions">

```
Find correct replacement text for the <missing_text> symbol. Your response must begin with a code block containing the replacement text, followed by an explanation. The first line of the code block must be a comment containing: path/to/file.js 10:5. Always refer to the symbol "<missing_text>" as "cursor position" and "replacement" as "completion".
<files>
  <document title="...">...</document> // selected websites
  ...
  <file path="...">...</file> // selected workspace files excluding current editor
  ...
  <file path="..."> // current editor
    ...
    <missing_text> // cursor position
    ...
  </file>
</files>
Find correct replacement text for the <missing_text> symbol. Your response must begin with a code block containing the replacement text, followed by an explanation. The first line of the code block must be a comment containing: path/to/file.js 10:5. Always refer to the symbol "<missing_text>" as "cursor position" and "replacement" as "completion".
```

  </TabItem>
</Tabs>

<hr />

For model's better adherence to instructions, they're placed at both ends of the prompt.<br />
[OpenAI Cookbook/Prompt Organization](https://cookbook.openai.com/examples/gpt4-1_prompting_guide#prompt-organization)

:::tip Practice single-turns

Chat conversations are only a construct of product interfaces, they hurt the quality of responses from the model and once your context is "poisoned" it will not recover. Whenever you're not satisfied with a response, **the best practice is to always refine your initial instructions and re-initialize a chat**.

:::

## Edit formats

Additional instructions are appended to your prompt in "General" mode, instructing the model to respond in an appropriate format. They can be customized in your `settings.json` file.

### Truncated

`codeWebChat.editFormatInstructionsTruncated`

> Whenever proposing a file use the markdown code block syntax and always add a file path in a comment on the top of the code block. Use ellipsis comments, e.g. "// ...", when appropriate.

### Whole

`codeWebChat.editFormatInstructionsWhole`

> Whenever proposing a file use the markdown code block syntax and always add a file path in a comment on the top of the code block. Please show me the full code of the changed files, I have a disability which means I can't type and need to be able to copy and paste the full code.

### Diff

`codeWebChat.editFormatInstructionsDiff`

> Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch.

## Presets

Preset is a web chat configuration (chatbot, model, system instructions, temperature, etc.). With the use of prefixes and suffixes, they can serve specific purpose in your workflow.

## Applying chat responses

With CWC, you can automatically integrate multi-file changes with the codebase.

Strategy depends on detected edit format:

- **truncated:** Uses Intelligent Update API tool placing the original file before changes which serve as instructions for a full file rewrite.
- **whole:** Simply replaces original files in place.
- **diff:** Uses the `git apply` utility before falling back to a custom diff processor.
